#ifndef __PLANE_H__
#define __PLANE_H__

#include "BasicType/BasicType.h"

namespace GCRE {
	namespace SceneModel {
		/***********************************************************************
	    *                                             Plane                                                     *
		*                               a * x + b * y + c * z + d = 0                                *
		************************************************************************/

		class Plane {
			public:
				Plane();
				Plane( const Plane& plane );
				Plane( const BasicType::SFVec3f& n, BasicType::SFFloat d );
				Plane( BasicType::SFFloat a, BasicType::SFFloat b, BasicType::SFFloat c, BasicType::SFFloat d );
				Plane( const BasicType::SFVec3f& n, const BasicType::SFVec3f& p );
				Plane( const BasicType::SFVec3f& A, const BasicType::SFVec3f& B, const BasicType::SFVec3f& C );

				Plane& operator=( const Plane& plane );

				void Set( BasicType::SFFloat a, BasicType::SFFloat b, BasicType::SFFloat c, BasicType::SFFloat d );
				void SetNormal( const BasicType::SFVec3f& normal );
				void SetDistance( BasicType::SFFloat d );
				BasicType::SFVec3f GetNormal() const;
				BasicType::SFFloat GetDistance() const;

			protected:

			private:
				BasicType::SFVec3f m_Normal;
				BasicType::SFFloat m_Distance;
		};

		inline void Plane::SetNormal( const BasicType::SFVec3f& normal ) { m_Normal = normal; }
		inline void Plane::SetDistance( BasicType::SFFloat d ) { m_Distance = d; }
		inline BasicType::SFVec3f Plane::GetNormal() const { return m_Normal; }
		inline BasicType::SFFloat Plane::GetDistance() const { return m_Distance; }
	}
}

#endif	//	__PLANE_H__